package isssr.dao.interfaces;

public class RecordSorting {
	
	public enum SortOrder {
		UNSORTED, ASCENDING, DESCENDING
	}
	
	
	private RecordSorting.SortOrder ordering;
	private String field;
	
	public RecordSorting(String field, RecordSorting.SortOrder ordering) {
		this.setRecordSortingFields(field, ordering);
	}
	
	public RecordSorting(String field)
	{
		this.setRecordSortingFields(field, RecordSorting.SortOrder.UNSORTED);
	}
	
	private void setRecordSortingFields(String field, RecordSorting.SortOrder ordering)
	{
		this.field = field;
		this.ordering = ordering;
	}
	
	public void setAscending()
	{
		this.ordering = RecordSorting.SortOrder.ASCENDING;
	}
	
	public void setDescending()
	{
		this.ordering = RecordSorting.SortOrder.DESCENDING;
	}
	
	public void setUnsorted()
	{
		this.ordering = RecordSorting.SortOrder.UNSORTED;
	}
	
	public RecordSorting.SortOrder getOrder()
	{
		return this.ordering;
	}
	
	public String getField()
	{
		return this.field;
	}
	
}
